home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 2: Applications
/
Linux Cubed Series 2 - Applications.iso
/
database
/
hl
/
hl-1.003
/
hl-1
/
DOCS
/
HomeLibr.doc
< prev
Wrap
Text File
|
1995-04-14
|
52KB
|
1,744 lines
Home Librarian
A Computerized Library Card Catalog
System
Robert Heller
Deepwoods Software
Wendell, MA, USA
April 10, 1994
This documentation was prepared with LaTEX.
This document describes version 1.0 Beta of the Home Librarian
package.
Copyright (c)1991, 1992 by Robert Heller D/B/A Deepwoods Software
All rights reserved. Permission is granted to copy this document in
electronic form only, so long as it is with the software it documents.
See Appendix B for complete licensing details.
The author, Robert Heller, may be contacted electronically (E-Mail)
via the following:
FidoNet 1:321/153, Locks Hill BBS.
CompuServe 71450,3432
BIX locks.hill.bbs
InterNet heller@cs.umass.edu
Contents
Preface vii
1 Introduction. 1
1.1 Basic Terminology . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 What is a Card Catalog Data Base? . . . . . . . 1
1.1.2 What is a "card"? . . . . . . . . . . . . . . . . . 1
1.2 Common GUI Definitions. . . . . . . . . . . . . . . . . . 4
1.2.1 Keyboard Defin1tions. . . . . . . . . . . . . . . . 4
1.3 How This Manual is Organized . . . . . . . . . . . . . . 5
1.3.1 Creating and Modifing a Data Base. . . . . . . . 5
1.3.2 Searching a Data Base. . . . . . . . . . . . . . . . 5
1.3.3 Getting Hard Copy of a Data Base. . . . . . . . . 5
1.3.4 Moving Data Bases Across Systems. . . . . . . . 5
1.3.5 Licensing and Registation. . . . . . . . . . . . . . 5
2 Editing a Librarian Data Base. 7
2.1 Invoking EditLibr. . . . . . . . . . . . . . . . . . . . . . 7
2.2 Using EditLibr. . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 The Main Command Menu. . . . . . . . . . . . . 8
2.2.2 Card Editor. . . . . . . . . . . . . . . . . . . . . . 11
3 Searching a Data Base. 15
3.1 Invoking Librarian. . . . . . . . . . . . . . . . . . . . . 15
3.2 Using Librarian. . . . . . . . . . . . . . . . . . . . . . . 15
3.2.1 The Quit Menu Item. . . . . . . . . . . . . . . . 15
3.2.2 The List Cards Menu Item. . . . . . . . . . . . 17
3.2.3 The List Titles Menu Item. . . . . . . . . . . . 17
i
ii CONTENTS
3.2.4 The List Authors Menu Item. . . . . . . . . . . 17
3.2.5 The List Subjects Menu Item. . . . . . . . . . 17
4 Printing Cards. 19
4.1 Invoking PrintCards. . . . . . . . . . . . . . . . . . . . 19
4.2 PrintCards Output. . . . . . . . . . . . . . . . . . . . . 21
5 Printing Labels. 23
5.1 Invoking PrintLabels. . . . . . . . . . . . . . . . . . . . 23
5.2 The Template File. . . . . . . . . . . . . . . . . . . . . . 23
5.3 PrintLabels Output. . . . . . . . . . . . . . . . . . . . 24
A Converting to and from Text Files. 25
A.1 Invoking Libr2Ascii. . . . . . . . . . . . . . . . . . . . 25
A.2 Invoking Ascii2Libr. . . . . . . . . . . . . . . . . . . . 26
A.3 When You Need to Use These Programs. . . . . . . . . . 26
B License and Warranty Information. 27
B.1 Copyright. . . . . . . . . . . . . . . . . . . . . . . . . . . 27
B.2 License. . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
B.2.1 License to use. . . . . . . . . . . . . . . . . . . . 27
B.2.2 License to copy. . . . . . . . . . . . . . . . . . . . 27
B.2.3 No Support. . . . . . . . . . . . . . . . . . . . . . 28
B.3 No Warranty. . . . . . . . . . . . . . . . . . . . . . . . . 28
C Registration: Why bother? 31
C.1 What is Shareware? . . . . . . . . . . . . . . . . . . . . . 31
C.2 What You Get When You Register. . . . . . . . . . . . . 31
C.3 If You Decide Not To Register. . . . . . . . . . . . . . . 32
C.4 Why Not Simply Make It a Commercial Package? . . . . 32
D Registration Form. 33
Index 35
List of Figures
1.1 Structure of a "Card Catalog Data Base". . . . . . . . . 2
2.1 Main command menu of EditLibr. . . . . . . . . . . . . 9
2.2 Edit Card Screen of EditLibr. . . . . . . . . . . . . . . . 12
3.1 Main command menu of Librarian. . . . . . . . . . . . 16
D.1 Registration Form . . . . . . . . . . . . . . . . . . . . . . 34
iii
iv LIST OF FIGURES
List of Tables
1.1 Indices in a "Card Catalog Data Base". . . . . . . . . . . 2
1.2 Fields in a "card". . . . . . . . . . . . . . . . . . . . . . 3
1.3 Allowed types for a "card". . . . . . . . . . . . . . . . . 3
1.4 Common Key Bindings. . . . . . . . . . . . . . . . . . . 4
2.1 Card Editor Key Bindings. . . . . . . . . . . . . . . . . . 12
4.1 PrintCards options . . . . . . . . . . . . . . . . . . . . . 20
4.2 Expression operators . . . . . . . . . . . . . . . . . . . . 20
4.3 Field types . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1 PrintLabels options . . . . . . . . . . . . . . . . . . . . 24
5.2 PrintLabels Template File Field Replacement Formats. 24
v
vi LIST OF TABLES
Preface
The Home Librarian system maintains a database of "cards", which de-
scribe books, magazines, video and audio tapes, CDs, record albums,
laser disks, and other simular items. The data is indexed by a unique
ID for each "card", a title index, an author index, and a subject in-
dex. Each card contains fields for a title, an author, a publisher, a
year, a volume number, a description, and an item type. The Home
Librarian package has six programs: EditLibr for editing card catalog
files, Librarian for searching card catalog files, PrintCards for make
card catalog cards, PrintLabels for printing item labels, Libr2Ascii for
dumping a card catalog file to a plain ASCII text format, and Ascii2Libr
for building a card catalog file from an ASCII text file (as generated by
Ascii2Libr).
I had two main goals in mind when I set out to write the Home
Librarian package. First I wanted to learn C++ by writing some "real"
programs, not just the exercises in the book, and secondly, I wanted
to write a package to help me deal with my growing library of science
fiction books, video tapes, and audio cassettes, which I estimate at
about 1,000 items. The first goal has pretty much been reached, in
that I believe I h1ve a good working feel for C++. My second goal is
still in progress . I also wanted to experiment with writing a shareware
package, to see if it is a viable source of income and not too much
hassle, that is, to see if the cost/benifit tradeoff is reasonable.
If you have any comments about this package, please let me know.
My electronic mail addresses are listed on the back side of the title page.
My postal address is listed in Appendix D. I would be very interested
in any comments users of the Home Librarian package might have.
_________________________________
1As of this writing, I have not completed putting everything into the database.
vii
viii Preface
I'd like to thank my friend Ephraim St. George Robbins for helping
me with this manual.
Robert Heller
Deepwoods Software
Wendell, MA, USA
Chapter 1
Introduction.
1.1 Basic Terminology
The Home Librarian package works over files that are "Card Catalog
Data Bases" which contain a number of "cards".
1.1.1 What is a Card Catalog Data Base?
A Card Catalog Data Base file contains a collection of "cards" that
describe items in your library, such as books, magizines, records, and
tapes. These cards are indexed with four indices as shown in Table 1.1.
Each index uses 35 character strings as keys. The keys are always com-
pared in a case-insensitive fashion. That is, "The Door Into Summer"
is the same as "THE DOOR INTO SUMMER". Internally, the keys are con-
verted to all uppercase letters. The id index indexes to the card records
directly. The other three indices index to lists of ids, and thus index
to the cards indirectly, as shown in Figure 1.1.
1.1.2 What is a "card"?
A card has a number of fields as shown in Table 1.2. The id field could
be an ISBN number, a LC call number, a Deuy-decimal call number,
or any other unique identification code. The type field must be one of
the types listed in Table 1.3. The author and title fields are used
for the author and title cross-references.
1
2 CHAPTER 1. INTRODUCTION.
___________Table_1.1:_Indices_in_a_"Card_Catalog_Data_Base".______________
|Name | Description |
|________|_____________________________________________________________|__
|id | This index is by a unique identifier. Each card |
| | has its own unique identifier. |
|title | This index is the title cross-reference. |
|author | This index is the author cross-reference. | |
|subject || This index is a subject index. ||
|________|__________________________________________________________|_____
Figure 1.1: Structure of a "Card Catalog Data Base".
(dbstruct.doc goes here)
1.1. BASIC TERMINOLOGY 3
________________________Table_1.2:_Fields_in_a_"card".__________________
|Name | Description |
|______________|_____________________________________________________|__
|id | A unique identifier. |
|type || The type of item the card describes. | |
|author || For the author (or artist). | |
|title || For the title. | |
|publisher | | For the name of the publisher. | |
|city | | For the city where the item was published. | |
|description | | For a long description. | |
|volume | | For the volume number. | |
|year || For the year published. | |
|_______________|__________________________________________________|____
___________________Table_1.3:_Allowed_types_for_a_"card"._____________
|Name | Description |
|_________________|________________________________________________|__
|Book | For books. |
|Magazine | | For magazines and periodicals. | |
|CD | | For compact disks. | |
|AudioCassette | | For audio cassettes. ||
|Album | | For record albums. ||
|LaserDisk | | For laser (video) disks. ||
|VHSVideo | For VHS format video tape recordings. | |
|BetaVideo | For Beta format video tape recordings.||
|EightMM || For 8mm video tape recordings. ||
|EightTrack || For 8-track audio recordings. | |
|DAT | | For 4mm digital audio tapes. ||
|Other | For anything else. | |
|__________________|______________________________________________|___
4 CHAPTER 1. INTRODUCTION.
____________________Table_1.4:_Common_Key_Bindings.___________________________
|Special Key | Generic Key | Meaning |
|_________________|___________________________|___________________________|___
|Home | Esc | Exit or quit |
|<- (left arrow) || Ctrl-B || Move left |
|-> (right arrow) || Ctrl-F | Move right ||
|^ (up arrow) | Ctrl-P | Move up |
|v (down arrow) || Ctrl-N | Move down ||
| | |Delete or Backspace | | Delete previous char- | |
| | | acter |
| |Return or Enter | Accept input or se- |
|_____________________|______________________|_____lection___________________|
1.2 Common GUI Definitions.
1.2.1 Keyboard Defin1tions.
Both the EditLibr and Librarian programs use a terminal-based
"Graphical User Interface" (GUI). This is1a very simple interface that
works on any video display terminal (VDT) . The GUI routines use
cursor positioning and reverse video or standout mode and do "raw"
terminal input (single character input with normal operating system
input editing disabled), much like a screen-based text editor such as
Emacs.
The input handling code expects a terminal that has arrow keys on
its keyboard, but will work with terminals whose keyboards do not have
arrow keys, by accepting "generic" control characters instead. These
"generic" control characters were taken from Emacs's positioning bind-
ings. The common (used in all screens, except as noted) key bindings
are listed in Table 1.4.
_________________________________
1If you are using OSK, you need to set the TERM environment variable to the
terminal type. Under MS-DOS, the terminal type is presumed to be an ANSI
terminal and you need to be running ANSI.SYS or something simular.
1.3. HOW THIS MANUAL IS ORGANIZED 5
1.3 How This Manual is Organized
This manual is organized by functions -- each chapter describes the
program(s) that perform a particular function.
1.3.1 Creating and Modifing a Data Base.
A data base file can be created and modified with the EditLibr program,
which is described in chapter 2. This program creates and modifies card
catalog data bases.
1.3.2 Searching a Data Base.
The Librarian program, which is described in chapter 3, is a program
meant to be used to search card catalog data bases.
1.3.3 Getting Hard Copy of a Data Base.
A "hard copy" of the data base can be created with the PrintCards
program which is described in chapter 4. This program is used to gen-
erate either 3x5 or 5x8 cards. These cards are much like old-fashioned
paper card catalogs.
The PrintLabels program, which is described in chapter 5, can be
used to print labels or generate any other sort of hard copy or any sort
of text file output from a card catalog data base.
1.3.4 Moving Data Bases Across Systems.
Appendix A is describes a pair of programs to convert a data base file
from its normal binary format to a readily transportable ASCII text
file format.
1.3.5 Licensing and Registation.
Appendix B contains the licensing information for this package. Ap-
pendix C talks about Shareware Registation. Appendix D contains a
Shareware Registation form for this package.
6 CHAPTER 1. INTRODUCTION.
Chapter 2
Editing a Librarian Data
Base.
A Card Catalog Data Base is created and edited with the EditLibr
prog1am. This program uses a simple menu-driven, terminal-based
GUI .
2.1 Invoking EditLibr.
EditLibr is invoked from the command line, as follows, to edit an
existing data base file:
EditLibr -editfile <filename>
or like this to create a new data base file:
EditLibr -editfile <filename> -minpages <pages>
where <filename> is the name of the file to be edited or created and
<pages> is the number of index pages to pre-allocate when creating
_________________________________
1See section 1.2 for GUI definations.
7
8 CHAPTER 2. EDITING A LIBRARIAN DATA BASE.
a new file. Each index page stores upto 21 index keys. Remember,
there are four indexes. If while editing your data base, you run out
of pre-allocated index pages, more will be allocated. The difference
will be that new index pages are allocated from the end of the file on
an as needed basis. If pages get allocated this way the index table
will be fragmented. Pre-allocating the pa2es puts them all new at the
beginning of the file, for faster access .
2.2 Using EditLibr.
2.2.1 The Main Command Menu.
When EditLibr starts up, it displays its main menu, as shown in Fig-
ure 2.1.
The Quit Menu Item.
The Quit menu item causes EditLibr to close the data base file and
exit.
The Edit a Card Menu Item.
The Edit a Card menu item is used to edit a specific card in the data
base. You are prompted for a card id, and the card editor is invoked.
The card editor is described in Section 2.2.2.
The Delete a Card Menu Item.
The Delete a Card menu item is used to delete a selected card by
its id. You are prompted for the id of the card to delete.
_________________________________
2These pages are cached using a simple "virtual memory" scheme, so disk access
is minimized.
2.2. USING EDITLIBR. 9
Figure 2.1: Main command menu of EditLibr.
_____________________________________________________________________________
| |
| |
| Main Command Menu |
| |
| Quit |
| Edit a Card |
| Delete a Card |
| Delete by Author |
| Delete by Title |
| Delete by Subject |
| List Cards |
| List Titles |
| List Authors |
| List Subjects |
| Spawn Shell |
| |
| |
| |
| |
| |
| |
| |
| |
|___________________________________________________________________________|
10 CHAPTER 2. EDITING A LIBRARIAN DATA BASE.
The Delete by Author Menu Item.
The Delete by Author menu item is used to delete some or all cards
for items written by a selected author. You are prompted for an author
and then the card ids for that author are listed one by one and you are
asked if you want to delete each card.
The Delete by Title Menu Item.
The Delete by Title menu item is used to delete some or all cards
for items with a selected title. You are prompted for an title and then
the card ids for that title are listed one by one and you are asked if you
want to delete each card.
The Delete by Subject Menu Item.
The Delete by Subject menu item is used to delete some or all cards
for items with a selected subject. You are prompted for an subject and
then the card ids for that subject are listed one by one and you are
asked if you want to delete each card.
The List Cards Menu Item.
The List Cards menu item lists cards with their titles which have a
common selected prefix for their id strings. You are prompted for a
search prefix and those cards with a matching prefix string in their id
string are listed. You have the option of editing a selected card.
The List Titles Menu Item.
The List Titles menu item lists titles with a common selected prefix
string. You are prompted for a search prefix and those titles with a
matching prefix strin3 are listed. You have the option of selecting one
of the listed titles , in which case t4e ids for the selected title are listed
(much as in the List Cards menu item) .
_________________________________
3If only one title matches, it is automatically selected
4If the title only refers to a single card, that card is placed in the card editor
directly
2.2. USING EDITLIBR. 11
The List Authors Menu Item.
The List Authors menu item lists authors with a common selected
prefix string. You are prompted for a search prefix and those authors
with a matching prefix str5ng are listed. You have the option of selecting
one of the listed authors , in which case the ids6for the selected author
are listed (much as in the List Cards menu item) .
The List Subjects Menu Item.
The List Subjects menu item lists subjects with a common selected
prefix string. You are prompted for a search prefix and those subjects
with a matching prefix stri7g are listed. You have the option of selecting
one of the listed subjects , in which case the id8 for the selected subject
are listed (much as in the List Cards menu item) .
The Spawn Shell Menu Item.
The Spawn Shell menu item forks a sub-shell process.
2.2.2 Card Editor.
When the card editor is invoked, it checks to see if the card to be
edited exists in the data base or not. If the card does not exist, you
are asked if you want to create a new card. The card editor then puts
up a screen as in Figure 2.2. The card editor defines the key bindings
shown in Table 2.1 The i (or I) key is used to modify fields. The id
field cannot be modified. When the displayed card is different from the
stored card, an asterisk (*) is displayed in the uppper left corner of the
screen. Most of the fields are updated by simply typing the i (or I) key
and then re-typing the field and pressing the Return or Enter key. Two
fields are different. The description and subject fields are modified
_________________________________
5If only one author matches, it is automatically selected
6If the author only refers to a single card, that card is placed in the card editor
directly
7If only one subject matches, it is automatically selected
8If the subject only refers to a single card, that card is placed in the card editor
directly
12 CHAPTER 2. EDITING A LIBRARIAN DATA BASE.
Figure 2.2: Edit Card Screen of EditLibr.
_____________________________________________________________________________
| |
| |
| Editing a Card |
| |
| Id: <id> Type: <type> |
| Title: <title> |
| Author: <author> |
| Publisher: <publisher> Year: <year> |
| City: <city> Vol: <volume> |
| Description: <description> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Subjects: <subject list> |
| |
| |
|___________________________________________________________________________|
___________________Table_2.1:_Card_Editor_Key_Bindings.______________
|Special Key | Generic Key | Meaning |
|_________________|___________________|___________________________|__
|Home | Esc | Exit |
|<- (left arrow) || Ctrl-B || Previous field ||
|-> (right arrow) || Ctrl-F | Next field ||
|^ (up arrow) | Ctrl-P | Previous field ||
|v (down arrow) || Ctrl-N | Next field ||
| | |Tab or Ctrl-I | | Next field |
| |i or I | | Modify current field | |
| |Ctrl-L || Repaint screen |
| |? | | Display help screen ||
| |Ctrl-S | | Save card | |
| |h or H || Give help for the cur- | |
|_____________________|_________________|__rent_field________________|
2.2. USING EDITLIBR. 13
9
using an external text editor . Entering the i (or I) key spawns the
external editor with a temp file containing the field to be modified.
_________________________________
9Defined by the EDITOR environment variable or umacs by default under OSK
and ??? by default under MS-DOS.
14 CHAPTER 2. EDITING A LIBRARIAN DATA BASE.
Chapter 3
Searching a Data Base.
The Librarian program is used to search a data base file. It1is meant
as a eletronic replacement for a card catalog. It uses a GUI
3.1 Invoking Librarian.
Librarian is invoked from the command line:
Librarian -infile <filename>
where <filename> is the name of the file to be searched.
3.2 Using Librarian.
When Librarian starts up, it displayes its main menu, as shown in
Figure 3.1.
3.2.1 The Quit Menu Item.
The Quit menu item causes Librarian to close the data base file and
exit.
_________________________________
1See section 1.2 for GUI definations.
15
16 CHAPTER 3. SEARCHING A DATA BASE.
Figure 3.1: Main command menu of Librarian.
_____________________________________________________________________________
| |
| |
| Main Command Menu |
| |
| Quit |
| List Cards |
| List Titles |
| List Authors |
| List Subjects |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|___________________________________________________________________________|
3.2. USING LIBRARIAN. 17
3.2.2 The List Cards Menu Item.
The List Cards menu item lists cards with their titles which have a
common selected prefix for their id strings. You are prompted for a
search prefix and those cards with a matching prefix string in their id
string are listed. You have the option of displaying a selected card.
3.2.3 The List Titles Menu Item.
The List Titles menu item lists titles with a common selected prefix
string. You are prompted for a search prefix and those titles with a
matching prefix strin2 are listed. You have the option of selecting one
of the listed titles , in which case t3e ids for the selected title are listed
(much as in the List Cards menu item) .
3.2.4 The List Authors Menu Item.
The List Authors menu item lists authors with a common selected
prefix string. You are prompted for a search prefix and those authors
with a matching prefix str4ng are listed. You have the option of selecting
one of the listed authors , in which case the ids5for the selected author
are listed (much as in the List Cards menu item) .
3.2.5 The List Subjects Menu Item.
The List Subjects menu item lists subjects with a common selected
prefix string. You are prompted for a search prefix and those subjects
with a matching prefix stri6g are listed. You have the option of selecting
one of the listed subjects , in which case the id7 for the selected subject
are listed (much as in the List Cards menu item) .
_________________________________
2If only one title matches, it is automatically selected
3If the title only refers to a single card, that card is displayed directly
4If only one author matches, it is automatically selected
5If the author only refers to a single card, that card is displayed directly
6If only one subject matches, it is automatically selected
7If the subject only refers to a single card, that card is displayed directly
18 CHAPTER 3. SEARCHING A DATA BASE.
Chapter 4
Printing Cards.
The PrintCards program is used to generate either 3x5 or 5x8 cards.
PrintCards can generate a shelf list, an author index, a title index, or
a subject index. Partial listings can also be generated.
4.1 Invoking PrintCards.
PrintCards is invoked from the command line like this:
PrintCards -infile <filename> <options>
Where <filename> is the file to print cards from and <options> consist
of zero or more of the options listed in Table 4.1. 1
The expression can contain the operators listed in Table 4.2 . Each
relational expression needs to specify a field name and a value. The
value must be of the correct type as shown in Table 4.3. Some example
expressions:
author="Norton, Andre"&type=Book
year>1990&type=CD
_________________________________
1Because some of these operators might be interpreted by the command processor
(shell), it may be necessary to escape or quote the expression string.
19
20 CHAPTER 4. PRINTING CARDS.
_______________________Table_4.1:_PrintCards_options_________________________
|Syntax | Description |
|_____________________________________|___________________________________|__
|-largep true|false | Selects between large (5x8) |
| | or small (3x5) cards. If |
| | true large cards are gen- |
| | erated and if false small |
| | cards are generated. |
|-by id|title|author|subject | Selects the type of card to |
| | generate: shelf list cards |
| | (id), title cards (title), au- |
| | thor cards (author), or sub- |
| | | ject cards (subject). |
|-only <expression> | Used to select |
| | a subset of cards to gener- |
| | ate. <expression> is a rela- |
|________________________________|________tional_expression_comparing_______|
fields to selected values.
Table 4.2: Expression operators
______________________________________________
|Operator | Meaning |
|_________|________________________________|__
|< | Less than |
|> | Greater than ||
|= | Equal to ||
|!= || Not Equal to | |
|<= | Less than or Equal to ||
|>= | Greater than or Equal to ||
|& || And | |
|| | Or ||
|! | Not ||
|(...) | | Expression grouping | |
|"..." | String constant | |
|__________|_______________________________|__
4.2. PRINTCARDS OUTPUT. 21
____________________________Table_4.3:_Field_types
|Field | Type |
|_____________|_________________________________|_
|type | Type name (see Table 1.3) |
|author | String constant | |
|title | String constant |
|publisher | | String constant |
|city | | String constant |
|volume | Integer constant |
|year | Integer constant |
|____________|_________________________________|__
type=CD|type=Album
publisher="Random House"&city="New York, NY"
type=CD&author="Guns and Roses"
type=EightTrack&author="Hank Williams, Jr."
type=EightMM
title="The Door Into Summer"
4.2 PrintCards Output.
The output of PrintCards is to the standard output stream. This can
be redirected with the output redirection command line character (>)
or piped with the pipe character (! under OSK or | under MS-DOS).
The output is meant for continous pin-fed index cards.
22 CHAPTER 4. PRINTING CARDS.
Chapter 5
Printing Labels.
The PrintLabels program is meant primarily to generate labels for
items in your library, but it can also be used to generate just about any
formated textual output.
5.1 Invoking PrintLabels.
PrintLabels is invoked from the command line like this:
PrintLabels -infile <filename> -template <tfile> <options>
Where <filename> is the file to print labels from, <tfile> is a template
file and <options> consist of zero or more of the options listed in
Table 5.1.
The expression can contain the operators listed in Table 4.2. Each
relational expression needs to specify a field name and a value. The
value must be of the correct type as shown in Table 4.3.
5.2 The Template File.
The template file is a text file that is copied to the standard output
stream for each card record processed. The file is copied literally, ex-
23
24 CHAPTER 5. PRINTING LABELS.
Table 5.1: PrintLabels options
_____________________________________________________________________________
|Syntax | Description |
|_____________________________________|___________________________________|__
|-by id|title|author|subject | Selects the type of label to |
| | generate: shelf list labels |
| | (id), title labels (title), |
| | author labels (author), or |
| | | subject labels (subject). |
|-only <expression> | Used to select |
| | a subset of labels to gener- |
| | ate. <expression> is a rela- |
|________________________________|________tional_expression_comparing_______|
_Table_5.2:_PrintLabels_Template_File_FielfdelRsetplsalcceemevnltesFormats.
|Field | Replaced by |
|_________________|___________________|___
|%% | % |
|%id | The id string. | |
|%type || The type. |
|%author || The author. ||
|%title || The title. | |
|%publisher | | The publisher. | |
|%city | | The city. | |
|%volume || The volume. | |
|%year || The year. ||
|%description | | The description. ||
|_____________|_______________________|___
cept when a % character is encounted. This character indicates a field
replacement as shown in Table 5.2.
5.3 PrintLabels Output.
The output of PrintLabels is to the standard output stream. This can
be redirected with the output redirection command line character (>)
or piped with the pipe character (! under OSK or | under MS-DOS).
Appendix A
Converting to and from Text
Files.
The Libr2Ascii program converts a data base file to a portable ASCII
text file. The Ascii2Libr takes the ASCII text file generated by
Libr2Ascii and re-creates the data base file. These programs are
meant for converting the data base files to a form that can be readily
transfered between different systems. The data base files themselves
use internal (CPU dependent) representation of the data stored, to al-
low rapid accessing and processing of the data. Another thing these
programs do is to "compress" data base files, by discarding deleted and
inaccessable data.
A.1 Invoking Libr2Ascii.
Libr2Ascii is invoked from the command line like this:
Libr2Ascii -infile <filename>
Where <filename> is the name of the file to be converted. The output
is sent to the standard output stream, where it can be redirected or
piped to other processing. This output is a plain text file.
25
26 APPENDIX A. CONVERTING TO AND FROM TEXT FILES.
A.2 Invoking Ascii2Libr.
Ascii2Libr is invoked from the command line like this:
Ascii2Libr -outfile <filename>
or like this to specify a new minimum page count:
Ascii2Libr -outfile <filename> -minpages <minpages>
Where <filename> is the name of the file to be created and <1inpages>
is the (optional) minimum number of index pages to allocate .
The input to Ascii2Libr is from the standard input stream.
A.3 When You Need to Use These Pro-
grams.
These programs convert a binary format card catalog data base file to
an easily transferable text file. All modern computer systems support
plain ASCII text files. The binary format contains processor-dependent
binary representations of the values use.
These two programs can also be used to "compress" a data base
file. EditLibr makes no attempt to re-cycle data records. This is due
in part because these records are variable length. Maintaining a table
of "deleted" records, along with their sizes would involve considerable
overhead. It is simpler to waste some disk space during the editing
process and reclaim it later with Libr2Ascii and Ascii2Libr.
_________________________________
1If <minpages> is not specified, the number of index pages to pre-allocate is
taken from the input stream and is just enough to hold the indices.
Appendix B
License and Warranty
Information.
B.1 Copyright.
The entire Home Librarian package is copyrighted (c) 1991,1992 by
Robert Heller (DBA) Deepwoods Software. All rights reserved, except
as noted in Section B.2.
B.2 License.
B.2.1 License to use.
The software package known as the Home Librarian package is licensed
to anyone to use at no charge or fee, on any number of machines, by
any number of users.
B.2.2 License to copy.
The Home Librarian package may be freely copied, SO LONG
AS THE COMPLETE PACKAGE OF SIX EXECUTABLE
PROGRAMS AND THE DOCUMENTATION FILES ARE
COPIED TOGETHER AS A UNIT. No charge or fee may be
27
28 APPENDIX B. LICENSE AND WARRANTY INFORMATION.
1
demanded for a copy of this package .
B.2.3 No Support.
Unless the package is registered, no customer support of any sort is
provided.
B.3 No Warranty.
BECAUSE THE Home Librarian PACKAGE IS LICENSED
FREE OF CHARGE, THERE IS NO WARRENTY FOR
THE PACKAGE, TO THE EXTENT PERMITTED BY AP-
PLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PACKAGE "AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EX-
PRESSED OR IMPLIED, INCLUDING, BUT NOT LIM-
ITED TO, THE IMPLIED WARRANTIES OF MER-
CHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PACKAGE IS WITH
YOU, THE USER. SHOULD THE PACKAGE PROVE DE-
FECTIVE, YOU ASSUME THE COST OF ALL NECES-
SARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE
LAW OR AGREED TO IN WRITING WILL ANY COPY-
RIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
REDISTRIBUTE THE PACKAGE AS PERMITED ABOVE,
BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUEN-
TIAL DAMAGES ARISING OUT OF USE OF THE USE
OR INABILITY TO USE THE PACKAGE (INCLUDING
BUT NOT LIMITED TO LOSS OF DATA OR DATA BE-
ING RENDERED INACCURATE OR LOSSES SUSTAINED
_________________________________
1A modest media or transmission charge or fee is allowed. This charge or fee
should not exceed the cost of the media or the cost of the transmission.
B.3. NO WARRANTY. 29
BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PACKAGE TO OPERATE WITH ANY OTHER PRO-
GRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
30 APPENDIX B. LICENSE AND WARRANTY INFORMATION.
Appendix C
Registration: Why bother?
C.1 What is Shareware?
Shareware is software that is distributed freely, but with a voluntary
fee. Generally, this fee gets some extra benefits. In some cases, source
code is provided. In others a nice manual and/or customer support is
provided. Sometimes the freely distributed version has limited function-
ality and registration provides a fully functional version of the package
or program.
C.2 What You Get When You Register.
The Home Librarian package is fully functional as distributed freely.
You don't need to register it to make full use of the package. There are
advantages to registering your copy of the Home Librarian package.
When you fill in the registration form (see Appendix D) and send
in your registration fee you will get two things:
╖ A printed manual, complete with a 3-ring binder. This will be
mailed to you using either UPS Ground or by special fourth class
via the USPS. This manual will be printed with a high-resolution
printer and the pages will be printed on both sides.
╖ Customer support. This means you can ask me questions and
I will try to answer them and try to help you with whatever
31
32 APPENDIX C. REGISTRATION: WHY BOTHER?
problems you might have. It also means I will really listen to
your suggestions and comments.
C.3 If You Decide Not To Register.
This is ok. You are stuck with the plain ASCII text version of the
manual that came with the package and are entirely on your own if
you have problems or questions. I will also "turn a deaf ear" to any
suggestion or comments.
C.4 Why Not Simply Make It a Com-
mercial Package?
Producing a slick, shrink-wrapped commercial package requires a cer-
tain amount of investment in time and resources. It would make the
package more costly to the user (much more than the registration fee)
and would put me in debt. If it did not sell I could be stuck with a
large debt. It is posible, if this package is extremly popular, that a
commercial version might be produced. As a shareware package, the
Home Librarian package can be distributed widely at low cost. A lot
of people can get a chance to try it out without having to pay. If
the package proves to be usefull, people can choose to pay the modest
registration fee and get a nice manual and customer support.
Appendix D
Registration Form.
This is the Shareware Registration Form for1the Home Librarian pack-
age. Copy this form and mail it with $25.00 to:
Robert Heller
D/B/A Deepwoods Software
51 Locke Hill Road
Wendell, MA 01379-9728
USA
_________________________________
1Check or money order, in USA funds, made payable to "Robert Heller".
33
34 APPENDIX D. REGISTRATION FORM.
Figure D.1: Registration Form
___________________________________________________________________________________
Please answer all 5 of the following questions:
1. Your name: _________________________________________________________________
2. Your mailing address: ____________________________________________________
____________________________________________________
____________________________________________________
3. Your e-mail address(es): __________________________________________________
__________________________________________________
__________________________________________________
___ ___
4. Which operating system are you using: MS-DOS |__| OSK |__|
5. Name of BBS or information serivce you downloaded the Home Li-
brarian from: ____________________________________________________________
The remaining questions are optional. You don't have to answer any of
the, but please try to answer as many as you feel like. These answers
will help me to make improvements in the Home Librarian package.
6. Percentages of items in your library are:
Printed materials (books_and magazines): ___ ___
0 to 20 |__| 21 to 40 |__| 41 to 60 |__| 61 to 80 |__| 81 to 100 |__|
Audio materials (albums,_CDs, DATs, audio cassettes,_8-tracks): ___
0 to 20 |__| 21 to 40 |__| 41 to 60 |__| 61 to 80 |__| 81 to 100 |__|
Video materials (VHS, Beta, 8mm, laser_disks): ___ ___
0 to 20 |__| 21 to 40 |__| 41 to 60 |__| 61 to 80 |__| 81 to 100 |__|
7. What do you like about the user interface of EditLibr and
Librarian? _____________________________________________________________
8. What do you not like about the user interface of EditLibr and
Librarian? _____________________________________________________________
___________________________________________________________________________________
Index
card, 1 form, 34
description, 1 What you get, 31
editing, 11
finding, 17 shareware
card catalog db, 1 What is, 31
compressing, 26
converting to text, 26 warranty, 28
editing, 7
index pages in, 7, 26
printing cards from, 19
printing labels from, 23
searching, 15
copyright, 27
GUI (Graphical User Interface),
4
card editor screen, 12
key bindings in, 11
editor main menu, 9
librarian main menu, 16
Label Template File, 23
field replacement in, 24
license, 27
-only expression, 19
examples of, 19--21
field types in, 21
operators in, 20
registration
35